<link rel="stylesheet" href="css/page.css" media="all" />
<style type="text/css">
	form.search{/* border-bottom:1px solid #eee;*/font-size: 14px; margin:15px auto; padding:5px;}
	form.search input.ltitle{ width: 214px;height: 30px;background-color: #f5f5f5;border: 1px solid #e5e5e5;padding: 0px 3px;}
	form.search input.lbtn{ width: 100px;height: 32px;margin-top: 10px;line-height: 32px;border: 0;margin-left: -5px;background-color: #00a0e9;font-weight: normal;color: #FFF;cursor:pointer; font-size:13px;}
	table.ter{ text-align:center; font-size:14px; color:#666; width:100%; border:1px solid #E5E3E3;}
	table.ter caption{ font-size:16px; font-weight:700; color:#000; text-align:center;}
	table.ter tr{ height:30px;}
	table.ter th,table td{font-size:12px;}
	table.ter th{ background:url('images/tabshutian.png') left center #F3F3F3 no-repeat; font-weight:normal;text-align:center;}
	table.ter th.fir{ background:#F3F3F3;}
	table.ter td{ color:#111; border-top:1px solid #E5E3E3;}
	table.ter .oper{ cursor:pointer}
	#popBox{ text-align:left; border:8px solid #767576; padding:20px;}
	#popBox .close{cursor:pointer;position:absolute; right:2px;top:2px;text-align:center; top:0px; font-size:14px; font-weight:bold;}
	#popBox h3{ color:#265895;font-weight:bold}
	#popBox textarea{ width:300px; height:80px;}
	#popBox  input.btn{padding:5px 10px; margin-right:20px; cursor:pointer; font-size:12px; }
</style>
<script type="text/javascript" src="http://www.16u.cc/js/r.js"></script>
<script src="http://www.16u.cc/d/js/popBox.js"></script>
<script src="/manage/js/Calendar.js" type="text/javascript"></script>
<div class="r_content">
	 <h3 class="mc_title">
	
		<span class="mctit_1"><a href="terchange.html"><span class="mctit_2">撤改审核</span></a></span>
		<span class="mctit_1 notcur"><a href="taobaolist.html"><span class="mctit_2">淘宝补单</span></a></span>
		<span class="mctit_1 notcur"><a href="code2Order.html"><span class="mctit_2">反查订单</span></a></span>
	</h3>
	<form class="search">
		<label>景区名称：</label><input type="text" name="ltitle" value="<?=$ltitle?>" class="ltitle"/>
		<input type="submit" value="查 询" class="lbtn"/>
	</form>
	<div class="tabCon">
		<table class="ter">
			<tr>
				<th class="fir">订单号</th>
				<th>变动</th>
				<th>原因</th>
				<th>申请时间</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			<?foreach($r as $row){?>
			<tr>
				<td title="<?=$row['fxid']?>"><a target="_blank" href="orderView.html?ordernum=<?=$row['ordernum']?>"><?=$row['ordernum']?></a></td>
				<td><?=$stypeT[$row['stype']]?></td>
				<td><?=$row['reason']?></td>
				<td><?=$row['stime']?></td>
				<td><?=$dstatusT[$row['dstatus']]?></td>
				<td>
                    <?if($row['action']):?>
                        <?if($row['dstatus']==0){?>
                        <a class="oper" orderid="<?=$row['ordernum']?>" inputV="<?=$row['id']."|".$row['ordernum']."|".$row['lid']."|".$row['tid']."|".$row['tnum']?>" data="<?=$row['fxid']?>">操作</a>
                        <?}else{?>
                            已处理
                        <?}?>
                    <?else:?>
                        <?echo ($row['dstatus']==0)? "等待处理":"已处理"?>
                    <?endif;?>
					
				</td>
			</tr>
			<?}?>
		</table>
	</div>
	<?page($total,$currentPage,$pageSize);?>
</div>
<div id="pop_tpl" style="display:none">
	<input type="hidden" id="today" value="<?=date("Y-m-d")?>"/>
	<a class="close" onclick="popBox.close()">关闭</a>
	<h3>终端订单变更操作</h3>
	<p class="tips"></p>
	<form action="http://n.12301.cc/oop/terminal_change.php" method="post">
		<input type="hidden" name="Did" class="Did"/>
		<input type="hidden" name="Dordernum" class="Dordernum"/>
		<input type="hidden" name="Ddstatus" class="Ddstatus"/>
		<input type="hidden" name="Ddadmin" value="<?=$_SESSION['memberID']?>" id="Ddadmin"/>
		<input type="hidden" name="Dlid" class="Dlid"/>
		<input type="hidden" name="Dtid" class="Dtid"/>
		<input type="hidden" name="Dnum" class="Dnum"/>
		
		<h4>备注填写：</h4>
		<textarea name="Dreason"></textarea></br>
		<p>（100字以内）</p>
		<input class="btn" type="button" onclick="oper(this,1)" value="同 意"/>
		<input class="btn" type="button" onclick="oper(this,2)" value="拒 绝"/>
	</form>
</div>	
<script>
var popBox=new PopWindow();
var oper=function(elem,tag){
	var textarea=$(elem).parent().find("textarea");
	if(tag==1){
		$("#popBox .Ddstatus").val("1");
		$("#popBox form").submit();
	}else{
		$("#popBox .Ddstatus").val("2");
		$("#popBox form").submit();
	}
}
$("a.denybtn").click(function(){
	var applyid=$(this).attr("applyid");
	$("#applyid").val(applyid);
	popBox.open($("#pop_tpl").html())
	return false;
})


$("table td a.oper").click(function(){	
	var orderid=$(this).attr("orderid");
	var inputV=$(this).attr("inputV");
	
	/*
	var validtime;
	$.ajax({
		"url":"terchange.html?orderid="+orderid+"&act=validtime",
		"type":"POST",
		"success":function(data){
			validtime=data;
				$("#pop_tpl .orderid").html(orderid);
				
				$("#pop_tpl .validtime").html(validtime);
				if(validtime.substr(0,10)!=$("#today").val()){
					$("#pop_tpl .tips").html("(已过订单验证日期，请确保订单未结算清分)");
				}else{
					$("#pop_tpl .tips").html("");
				}
		}
	});*/
	
	inputV=inputV.split("|");
	$("#pop_tpl .Did").val(inputV[0]);
	$("#pop_tpl .Dordernum").val(inputV[1]);
	$("#pop_tpl .Dlid").val(inputV[2]);
	$("#pop_tpl .Dtid").val(inputV[3]);
	$("#pop_tpl .Dnum").val(inputV[4]);
	$("#Ddadmin").val($(this).attr("data"));
	popBox.open($("#pop_tpl").html());
	return false;
});
</script>